//
//  IMB_NetUtils.m
//  InvestChina
//
//  Created by 闫建刚 on 14-4-1.
//  Copyright (c) 2014年 iMobile. All rights reserved.
//

#import "IMB_NetUtils.h"
#import <Reachability/Reachability.h>


@implementation IMB_NetUtils

// 检测2G/3G网络状态
+ (BOOL) checkGPRSNet{
    NetworkStatus status = [[Reachability reachabilityForInternetConnection] currentReachabilityStatus];
    return (status == ReachableViaWWAN);
}

// 检测Wifi网络状态
+ (BOOL) checkWifiNet{
    NetworkStatus status = [[Reachability reachabilityForInternetConnection] currentReachabilityStatus];
    return (status == ReachableViaWiFi);
}

// 检测网络连接状态
+ (BOOL)isNetConnect{
    if ([IMB_NetUtils checkWifiNet] || [IMB_NetUtils checkGPRSNet]) {
        return YES;
    }
    return NO;
}


@end
